package com.kly.user.rulePolicy.enums;

public enum OperationTypeEnum {


    /**
     * 变量| 常量 
     */
    VARIABLE, CONSTANT;

    public static OperationTypeEnum transformByType(Integer type) {
        for (OperationTypeEnum opTypeEnum : OperationTypeEnum.values()) {
            if (opTypeEnum.ordinal() + 1 == type) {
                return opTypeEnum;
            }
        }
        return null;
    }

    public static OperationTypeEnum transformByName(String name) {
        for (OperationTypeEnum opTypeEnum : OperationTypeEnum.values()) {
            if (opTypeEnum.name().equalsIgnoreCase(name)) {
                return opTypeEnum;
            }
        }
        return null;
    }


}
